<%@ page language="java" contentType="text/html; charset=UTF-8"
    import="ecs.dogear.app.*"
    pageEncoding="UTF-8"%>
<%
    String name = request.getParameter("n");
    int i = 1;
    while(CommenterDatabase.getUser(i) != null) {
    	if(CommenterDatabase.getUser(i).getName().equals(name))
    		break;
    	i++;
    }
    if(CommenterDatabase.getUser(i)==null){
    	AddUserTransaction aut = new AddUserTransaction(i,name);
        aut.execute();
    }
    String handler = request.getParameter("callback");
    out.println(handler + "({userId:'"+i+"'})");
%>